var score = [(n = 90)];

function suiji(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

while (score > 80 && score < 100) {
  var a = suiji(0, 10);
  var b = suiji(0, 10);
  let answer = prompt(a + "+" + b + "= ?", "请输入数字");
  if (a + b == answer) {
    alert("不错，有点水平!");
  } else {
    alert("菜的离谱兄弟");
  }
  if (a + b == answer) {
    score.pop(0), score.push(n++);
  } else {
    score.shift(0), score.unshift(n--);
  }
  alert("你现在评分是" + score[0] + "分啦，小可爱！");
}
